package cn.yunhe.service.serviceImpl;

import cn.yunhe.dao.UserQuestionRateDao;
import cn.yunhe.entity.Field;
import cn.yunhe.entity.User;
import cn.yunhe.entity.UserQuestionHistory;
import cn.yunhe.pojo.UserQuestionRate;
import cn.yunhe.service.UserQuestionRateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;
@Service("userQuestionRateService")
public class UserQuestionRateServiceImpl implements UserQuestionRateService {
    @Autowired
    @Qualifier("userQuestionRateDao")
    private UserQuestionRateDao userQuestionRateDao;
    @Override
    public List<UserQuestionRate> getQuesHRate(int fieldId, int userid) {
        Field field1 = new Field();
        field1.setFieldId(fieldId);
        UserQuestionHistory userQuestionHistory = new UserQuestionHistory();
        userQuestionHistory.setUserId(userid);
        List<UserQuestionRate> userQuestionRates =   userQuestionRateDao.getQuesHRate(field1,userQuestionHistory);
        return userQuestionRates;
    }
}
